package com.jxlc.framework.oauth2.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.Set;

/**
 * OAuth2 刷新令牌
 *
 */
@TableName(value = "oauth2_refresh_token", autoResultMap = true)
@Data
@Accessors(chain = true)
public class OAuth2RefreshToken {

    /**
     * 编号，数据库字典
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 刷新令牌
     */
    private String refreshToken;
    /**
     * 用户编号
     */
    private Long userId;
    /**
     * 登录类型
     *
     */
    private String loginType;
    /**
     * 客户端编号
     *
     */
    private Long clientId;
    /**
     * 授权范围
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Set<String> scopes;
    /**
     * 过期时间
     */
    private LocalDateTime expiresTime;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 删除标识
     */
    @TableLogic
    private Integer deleted;

}
